package ch.fusun.baron.player.api;

/**
 * Represents a country
 */
public class Country {

	private final int ID;
	private final String name;

	/**
	 * Kryo
	 */
	public Country() {
		ID = 0;
		name = ""; //$NON-NLS-1$
	}

	/**
	 * @param ID
	 * @param name
	 */
	public Country(int ID, String name) {
		this.ID = ID;
		this.name = name;
	}

	@Override
	public int hashCode() {
		return ID;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Country other = (Country) obj;
		if (ID != other.ID)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	/**
	 * @return The name
	 */
	public String getName() {
		return this.name;
	}

}
